﻿/*
    Copyright 2010, 2011 Eric Wong
	contact@optimalcycling.com
	http://www.optimalcycling.com
	Optimal Cycling - Advanced power pacing program for cyclists
	
	This file is part of Optimal Cycling.

    Optimal Cycling is free software: you can redistribute it and/or modify
    it under the terms of the GNU Lesser General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    Optimal Cycling is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU Lesser General Public License for more details.

    You should have received a copy of the GNU Lesser General Public License
    along with Optimal Cycling.  If not, see <http://www.gnu.org/licenses/>.
*/

#ifndef _FILE_CONSTANTS_H_
#define _FILE_CONSTANTS_H_

#ifdef REAL_IS_DOUBLE
	#define NEG_ONE  (-1.0)
	#define NEG_TWO  (-2.0)
	#define SQRT_TWO 1.4142135623730950488016887242097
	#define JITTER  SMALL_REAL
	#define THREE_THIRTY_SECOND	0.09375
	#define ONE_TENTH	0.1
	#define ONE_QUARTER	0.25
	#define NINE_THIRTY_SECOND	0.28125
	#define THREE_EIGHTH	0.375	
	#define ONE_HALF  0.5
	#define THREE_QUARTERS	0.75
	#define ONE  1.0
	#define ONE_HUNDRED 100.0
	#define TWO  2.0
	#define FOUR  4.0
	#define EIGHT  8.0
	#define MINUTES_TO_SECONDS  60.0
	#define INCH_POUNDS_TO_NEWTON_METRES  0.11298482933
	#define MILES_PER_HOUR_TO_METRES_PER_SECOND  0.44704
	#define KM_PER_HOUR_TO_METRES_PER_SECOND  0.277777777777778
	#define METRES_PER_SECOND_TO_KM_PER_HOUR  3.6
	#define MILES_TO_METRES  1609.344
	#define KM_TO_METRES  1000.0
	#define GRAVITY  9.80665
	#define PI  3.1415926535897932384626433832795028841971693993751058209749
	#define QUARTER_PI  0.7853981633974483096156608458198757210492923498437764552437
	#define EIGTH_PI  0.3926990816987241548078304229099378605246461749218882276218

	#define FRAC_12_13	0.9230769230769230
	#define FRAC_1932_2197	0.8793809740555300
	#define FRAC_7200_2197	3.2771961766044600
	#define FRAC_7296_2197	3.3208921256258500

	#define FRAC_439_216	2.0324074074074100
	#define FRAC_3680_513	7.1734892787524400
	#define FRAC_845_4104	0.2058966861598440

	#define FRAC_8_27	0.2962962962962960
	#define FRAC_3544_2565	1.3816764132553600
	#define FRAC_1859_4104	0.4529727095516570
	#define FRAC_11_40	0.275

	#define FRAC_1_360	0.0027777777777778
	#define FRAC_128_4275	0.0299415204678363
	#define FRAC_2197_75240	0.0291998936735779
	#define FRAC_1_50	0.02
	#define FRAC_2_55	0.0363636363636364

	#define FRAC_25_216	0.1157407407407410
	#define FRAC_1408_2565	0.5489278752436650
	#define FRAC_2197_4104	0.5353313840155950
	#define FRAC_1_5	0.2
#else
	#define NEG_ONE  (-1.0f)
	#define NEG_TWO  (-2.0f)
	#define SQRT_TWO 1.4142135623730950488016887242097f
	#define JITTER  SMALL_REAL
	#define THREE_THIRTY_SECOND	0.09375f
	#define ONE_TENTH	0.1f
	#define ONE_QUARTER	0.25f
	#define NINE_THIRTY_SECOND	0.28125f
	#define THREE_EIGHTH	0.375f	
	#define ONE_HALF  0.5f
	#define THREE_QUARTERS	0.75f
	#define ONE  1.0f	
	#define ONE_HUNDRED 100.0f
	#define TWO  2.0f
	#define FOUR  4.0f
	#define EIGHT  8.0f
	#define MINUTES_TO_SECONDS  60.0f
	#define INCH_POUNDS_TO_NEWTON_METRES  0.11298482933f
	#define MILES_PER_HOUR_TO_METRES_PER_SECOND  0.44704f
	#define KM_PER_HOUR_TO_METRES_PER_SECOND  0.277777777777778f
	#define METRES_PER_SECOND_TO_KM_PER_HOUR  3.6f
	#define MILES_TO_METRES  1609.344f
	#define KM_TO_METRES  1000.0f
	#define GRAVITY  9.80665f
	#define PI  3.1415926535897932384626433832795028841971693993751058209749f
	#define QUARTER_PI  0.7853981633974483096156608458198757210492923498437764552437f
	#define EIGTH_PI  0.3926990816987241548078304229099378605246461749218882276218f

	#define FRAC_12_13	0.9230769230769230f
	#define FRAC_1932_2197	0.8793809740555300f
	#define FRAC_7200_2197	3.2771961766044600f
	#define FRAC_7296_2197	3.3208921256258500f

	#define FRAC_439_216	2.0324074074074100f
	#define FRAC_3680_513	7.1734892787524400f
	#define FRAC_845_4104	0.2058966861598440f

	#define FRAC_8_27	0.2962962962962960f
	#define FRAC_3544_2565	1.3816764132553600f
	#define FRAC_1859_4104	0.4529727095516570f
	#define FRAC_11_40	0.275f

	#define FRAC_1_360	0.0027777777777778f
	#define FRAC_128_4275	0.0299415204678363f
	#define FRAC_2197_75240	0.0291998936735779f
	#define FRAC_1_50	0.02f
	#define FRAC_2_55	0.0363636363636364f

	#define FRAC_25_216	0.1157407407407410f
	#define FRAC_1408_2565	0.5489278752436650f
	#define FRAC_2197_4104	0.5353313840155950f
	#define FRAC_1_5	0.2f

#endif		// REAL_IS_DOUBLE

#endif		// _FILE_CONSTANTS_H_

